home *** CD-ROM | disk | FTP | other *** search
/ Wonky Flux Batch 2019 02 / Wonky_Flux_Batch_2019-02.zip / Wonky Flux Batch 2019-02 / 093 - Land of Spur.dsk / SPUR.UTIL.S < prev   
Text File  |  2019-02-17  |  10KB  |  291 lines

  1.                          ; _  _  _  _  _  _  _  _ 
  2.                          ;[_][_][_][_][_][_][_][_]
  3.                          ;
  4.                          ;     The Land of SPUR
  5.                          ;
  6.                          ;     (C)opyright 1987
  7.                          ;       Greg W. Davis
  8.                          ;            and
  9.                          ;     Peripherals Plus
  10.                          ;
  11.                          ; 03/18/87          19:42   
  12.                          ; _______________________
  13.                          ;          v3.0
  14.                          ;      Spur Utilities
  15.                          ; _  _  _  _  _  _  _  _
  16.                          ;[_][_][_][_][_][_][_][_]
  17.  
  18.  
  19.           on nocar goto linkterm
  20.  
  21.           
  22. main
  23.           input \"SPUR Utility (?=Menu): "i$
  24.           push main
  25.  
  26.           if i$="S" goto search
  27.           if i$="C" goto cross
  28.           if i$="D" goto show.obj
  29.           if i$="P" goto purge
  30.           if i$="G" goto workshet
  31.           if i$="Q" goto quit
  32.           if i$<>"?" return
  33.  
  34. menu
  35.           setint(1):print \s$\'
  36. [------------------------------------]
  37. [                  Sysop Utility Menu        ]
  38. [------------------------------------]
  39. [                 [S] Search                 ]
  40. [                 [C] Cross Reference        ]
  41. [                 [D] Room Descriptions      ]
  42. [                 [P] Purge Old Users        ]
  43. [                 [G] Grid Printer           ]
  44. [                 [Q] Quit                   ]
  45. [------------------------------------]':setint(""):return
  46.  
  47. room.def
  48.           input @2\"Rooms on which level "i$
  49.           if i$="" pop:return
  50.           x=val(i$):if (x<1) or (x>lc) print \lc" levels only":goto room.def
  51.           dr$=dx$+"room.level"+i$:f1$=dx$+"d.level"+i$
  52.           open #1,f1$:input #1,ln$,nr,ri:close #1
  53.           dy$=dm$+"mail":ready dy$
  54.           open #1,dr$:a=mark(1):close #1
  55.           if a print \"No rooms to read":pop:return
  56.           ready dr$
  57.           return
  58.           
  59. search
  60.           gosub room.def
  61. srch.1
  62.           print \"(I)tem  (M)onster  (R)ation  (W)eapon"
  63.           input @2\"Enter search type: "a$
  64.           if a$="" return
  65.           a$=left$(a$,1)
  66.           if not instr(a$,"IMRW") goto srch.1
  67. srch.2
  68.           input @2\"Enter #: "a
  69.           if a=0 return
  70.           x=1
  71.           
  72. srch.3
  73.           print \"Scanning # [" x "]";
  74. srch.4
  75.           input #msg(x),lo$,m,i,wp,fd,n
  76.           setint(1)
  77.           if (a$="I") and (a=i) print \\"Item # "i" found in room # "x:goto srch.6
  78.           if (a$="M") and (a=m) print \\"Monster # "m" found in room # "x:goto srch.6
  79.           if (a$="R") and (a=fd) print \\"Ration # "fd" found in room # "x:goto srch.6
  80.           if (a$="W") and (a=wp) print \\"Weapon # "wp" found in room # "x:goto srch.6
  81.           if key(1) print \\"Search aborted":goto srch.1
  82.           if x<nr then x=x+1:y=len(str$(x-1))+1:print chr$(8,y) x "]";:goto srch.4
  83.           goto srch.7
  84. srch.6
  85.           x=x+1:if (key(1)) or (x>nr) goto srch.7
  86.           goto srch.3
  87. srch.7
  88.           print \\"Search complete.":goto srch.1
  89.           
  90. cross
  91.           gosub room.def
  92.           gosub ptr.pmt
  93.           q=0:y=18:if o=5 then y=60
  94.           x=1
  95.           gosub header
  96.           
  97. rm.prt1
  98.           input #msg(x),lo$,m,i,wp,fd,n,s,e,w,rc,rt
  99.           setint(1)
  100.           if lo$="" goto rm.prt3
  101.           print #o,right$("    "+str$(x),4)"   ";
  102.           print #o,left$(lo$+"                         ",25)"  ";
  103.           if m print #o,right$("   "+str$(m),3);:else print #o,"   ";
  104.           print #o,"  "  ;:if i print #o,right$("   "+str$(i),3);:else print #o,"   ";
  105.           print #o,"  "  ;:if wp print #o,right$("   "+str$(wp),3);:else print #o,"   ";
  106.           print #o,"  "  ;:if fd print #o,right$("   "+str$(fd),3);:else print #o,"   ";
  107.           print #o,"   " ;:if n print #o,"Y";:else print #o," ";
  108.           print #o," "   ;:if s print #o,"Y";:else print #o," ";
  109.           print #o," "   ;:if e print #o,"Y";:else print #o," ";
  110.           print #o," "   ;:if w print #o,"Y";:else print #o," ";
  111.           print #o,"  "  ;:if rc=1 print #o," Y";:else print #o,"  ";
  112.           print #o,"  "  ;:if rc=2 print #o," Y";:else print #o,"  ";
  113.           if rt>0 print #o,right$("      "+str$(rt),6):else print #o
  114.           q=q+1:if (not q mod 60) and (o=5) then for i=1 to 4:print #o:next:gosub header
  115.           if (not q mod 15) and (o=0) print\\:gosub header
  116. rm.prt3
  117.           if (x<nr) and (not key(1)) then x=x+1:goto rm.prt1
  118.           return
  119.           
  120. header
  121.           print #o,"Numb   Name                       Mon  Itm  Wep  Rat   ";
  122.           print #o,"N S E W  Up  Dn  Room"
  123.           print #o,"----   -------------------------  ---  ---  ---  ---   ";
  124.           print #o,"- - - -  --  --  ----"
  125.           return
  126.  
  127. show.obj
  128.           gosub room.def
  129.           gosub ptr.pmt
  130.           dy$=dx$+"monsters"
  131.           dw$=dx$+"items"
  132.           a$=dx$+"stores"
  133.           b$=dx$+"weapons"
  134.  
  135.           input @2\"Start at room # "x:if x<1 return
  136.           if x>nr then x=nr
  137.  
  138. show.1
  139.           edit(0)
  140.           input #msg(x),lo$,m,i,wp,fd,n,s,e,w,rc,rt
  141.           if lo$="" goto show.7
  142.           copy #6,#8
  143.           setint(1)
  144.           print #o,\md$
  145.           print #o,"Room Number :"x\
  146.           print #o,"Monster :";:if (not m) print #o:goto show.2
  147.           open #1,dy$:position #1,32,m:input #1,cb$\m$:close
  148.           print #o," # "right$("   "+str$(m),3)" - "mid$(m$,3)
  149. show.2
  150.           print #o,"Item    :";:if (not i) print #o:goto show.3
  151.           open #1,dw$:position #1,30,i:input #1,cb$\it$:close
  152.           print #o," # "right$("   "+str$(i),3)" - "mid$(it$,3)
  153. show.3
  154.           print #o,"Weapon  :";:if (not wp) print #o:goto show.4
  155.           open #1,b$:position #1,34,wp:input #1,cb$\w$:close
  156.           print #o," # "right$("   "+str$(wp),3)" - "mid$(w$,3)
  157. show.4
  158.           print #o,"Ration  :";:if (not fd) print #o:goto show.5
  159.           open #1,a$:position #1,26,fd:input #1,cb$\it$:close
  160.           print #o," # "right$("   "+str$(fd),3)" - "mid$(it$,3)
  161. show.5
  162.           print #o
  163.           print #o,"Exits        :";
  164.           if n print #o," North";
  165.           if s print #o," South";
  166.           if w print #o," West";
  167.           if e print #o," East";
  168.           print #o
  169.           print #o,\"Room command : ";:if rc=1 print #o,"UP";:else if rc=2 print #o,"DOWN";:else print #o,"NONE":goto show.6
  170.           if (rc>0) and (rt>0) print #o," - to #"rt:else if (rc>0) and (rt=0) print #o," - Shoppe":else print #o
  171. show.6
  172.           print #o,"Room Name    : "lo$
  173.           print #o,\"Room Description :"\
  174.           copy #8,#o
  175.           print #o,\
  176. show.7
  177.           x=x+1:if (x>nr) or (key(1)) return
  178.           if lo$="" goto show.1
  179.           if o=0 print md$:input @2\"Q=Quit, C/R=Continue: "i$:if i$="Q" return
  180.           goto show.1
  181.  
  182. purge
  183.           input @0\"Purge Inactive Users? "i$
  184.           if i$<>"Y" return
  185.           print \"Purging users..."\\s$\
  186.           x=0
  187. purge.1
  188.           print \"Scanning SPUR user file"
  189.           dy$=dx$+"spur.users":dw$="b:users"
  190.           open #1,dy$:open #2,dw$
  191.           print \"User # [" x "]";
  192. purge.2
  193.           x=x+1:if (x>np) or (key(1)) goto purge.5
  194.           y=len(str$(x-1))+1:print chr$(8,y) x "]";
  195.           position #1,130,x
  196.           input #1,n$,b1
  197.           position #2,64,b1
  198.           input #2,a$,b$
  199.           if a$<>"" goto purge.2
  200. purge.3
  201.           print \"Purging user # "x
  202.           q=q+1
  203.           position #1,130,x
  204.           print #1,0,0
  205.           close
  206.  
  207.           dy$=dx$+"weapons":dw$=dx$+"spur.weapons"
  208.           open #1,dy$:open #2,dw$
  209.           position #2,64,x
  210.           input #2,a,i$
  211.           if a=0 close:goto purge.4
  212.           for j=1 to a
  213.           y=val(i$):i$=mid$(i$,5)
  214.           if y>10 position #1,34,y:print #1,"1"
  215.           next:close
  216. purge.4
  217.           dy$=dx$+"allies":dw$=dx$+"spur.allies"
  218.           open #1,dy$:open #2,dw$
  219.           position #2,78,x
  220.           for j=1 to 3
  221.           input #2,x1$,x1,x2
  222.           position #1,26,x2
  223.           if x2<>0 print #1,1
  224.           next:close
  225.           goto purge.1
  226. purge.5
  227.           close:print \q" users deleted.":return
  228.           
  229. workshet
  230.           if info(0) print \"Local mode only!":return
  231.           if (not pq) print \"Printer not defined..."\:return
  232.           o=5:l=7
  233.           print \"Print Level Development Worksheet"\
  234. wksht.1
  235.           input @2\"Enter Number of Rooms ACROSS: "a$
  236.           if a$="" return
  237.           s=val(a$):if (s<2) or (s>30) print \"Enter 2-30.":goto wksht.1
  238. wksht.2
  239.           input @2\"Enter Character Width of PAPER: "a$
  240.           if a$="" goto wksht.1
  241.           b=val(a$):if (b<80) or (b>230) print \"Enter 80-230.":goto wksht.2
  242.           input @2\\"Ready PRINTER - Hit RETURN :"b$
  243.           print #o,chr$(9)a$"N";
  244.           w=b/10:x1=s:x2=s
  245.           
  246. length
  247.           b=l:if x2<b then b=x2
  248.           x2=x2-b
  249. width
  250.           a=w:if x1<a then a=x1
  251.           x1=x1-a
  252.           gosub prt.grid
  253.           gosub cont:print #o,chr$(12)
  254.           if x1<>0 goto width
  255.           if x2=0 return
  256.           x1=s:goto length
  257.           
  258. prt.grid
  259.           d=a-1:c=0
  260. grid1
  261.           print #o,"|------|";
  262.           if d=0 then print #o:x=0:goto grid2:else for y=1 to d::print #o,"  |------|";:next:print #o
  263.           x=0
  264. grid2
  265.           print #o,"|      |";
  266.           if d=0 then print #o:else for y=1 to d:print #o,"  |      |";:next print #o
  267.           x=x+1:if x<5 goto grid2
  268.           print #o,"|------|";
  269.           if d=0 then print #o,\\:else for y=1 to d:print #o,"  |------|";:next:print #o,\\
  270.           c=c+1:if c<b goto grid1
  271.           return
  272.           
  273. cont
  274.           input @2\"Press Return to continue "a$:return
  275.           
  276. ptr.pmt
  277.           o=0:if info(0) return
  278.           q$="":input @0\"Send output to printer? "q$
  279.           if q$="Y" then o=5
  280.           return
  281.           
  282. relink
  283.           dw$=ds$+"spur.sysop":link dw$,"relink"
  284.           
  285. quit
  286.           pop:dy$=ds$+"spur.sysop"
  287.           link dy$
  288.           
  289. linkterm
  290.           dy$=dz$+"spur.logon":link dy$,"quit3"
  291.